package com.xing.service.mq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by Bradish7Y on 2017/8/23.
 */
@Component
public class Consumer {
    public static final Logger log = LoggerFactory.getLogger(Consumer.class);

    @RabbitListener(queues = "test")
    public void listener(Message message) {

        log.info("content:{}", new String(message.getBody()));
    }
}
